<?php
class DepartmentModel extends Model {
	public function getlist($where,$fields) {
		if($where) $this->where($where);
		if($fields) $this->field($fields);else $this->field('*');
		foreach($this->select() as $value){
			$value['leaf'] = true;
			$value['text'] = $value['name'];

			$list[] = $value;
		}
		unset($value);
		return json_encode($list);
	}
	public function getlist_user($fields) {
		if($fields) $this->field($fields);else $this->field('*');
		foreach($this->select() as $value){
			$list[] = $value;
		}
		unset($value);
		return json_encode($list);
	}

}